home *** CD-ROM | disk | FTP | other *** search
- Path: grimsel.zurich.ibm.com!usenet
- From: wgk@zurich.ibm.com (Keith Whittingham)
- Newsgroups: comp.lang.c++
- Subject: Re: Assembly and Turbo C++?
- Date: 6 Apr 1996 10:31:18 GMT
- Organization: IBM Research, ZRH
- Message-ID: <4k5h5m$tfv@grimsel.zurich.ibm.com>
- References: <31657857.1950825@news.lafn.org>
- Reply-To: wgk@zurich.ibm.com
- NNTP-Posting-Host: pine.zurich.ibm.com
- X-Newsreader: IBM NewsReader/2 v1.00
-
- In <31657857.1950825@news.lafn.org>, ay011@lafn.org (Danny Yoo) writes:
- > I'm trying to learn more about sprite programming/animation.
- >I've picked up a book, "Zen of Graphics Programming" by Michael
- >Abrash. Opening the tome up, I realize: I don't know how to use
- >assembly! I'm using Turbo C++ 3.0 (ugh) and I'm planning to get 5.0,
-
- Don't dispair, I'm using 3.1 and it's fine for the job...
-
- If you type (in an edit window) asm and hit the Ctrl-F1 it'll tell
- you all you need to do. You can do either of the following:
-
- main()
- {
- asm mov ax,bx
- asm inc ax // Etc.
- int i;
- asm {
- xor ax,ax
- mov i,ax
- }
- printf("%d\n", i);
- }
-
- Which is pretty neat all in all. It's a hell of a lot easier than
- calling assembler from C or vice versa.
-
- Assembler is quite easy to understand until you have to start
- messing around with Intel architecture which is a mess and
- as fast as I understand one chip they keep bringing out a
- new one.
-
- As a rule of thumb try and convert as much as you can to C/C++
- except anything you need to be really fast. Don't corrupt
- registers you shouldn't, I only change ax,bx,cx,dx and flags
- anything else is pushed and popped.
-
- Keith
-
-
-